#include"processBar.h"
#include<string.h>
#include<unistd.h>
#define GREEN "\033[0;32;32m"
#define NONE "\033[m"

const char* lable="|/-\\";

void processbar()
{
    char bar[NUM];
    memset(bar,'\0',sizeof(bar));
    int i=0;
    while(i<=100)
    {
       printf(GREEN"[%-100s]"NONE"[%d%%](%c)\r",bar,i,lable[i%4]);
       fflush(stdout);
       bar[i++] = STYLE;
       if(i<100) bar[i]='>';
       usleep(100000);
    }    
    printf("\n");
}
